package net.wexoo.group_cost_calculator.enitities;

import java.util.Date;
import java.util.List;

import com.j256.ormlite.field.DatabaseField;
import com.j256.ormlite.table.DatabaseTable;

@DatabaseTable(tableName = Calculation.TABLE_NAME)
public class Calculation extends DatabaseEntity {

   public static final String TABLE_NAME = "calculation";
   public static final String TITLE_COLUMN = "title";
   public static final String CREATE_DATE_COLUMN = "create_date";
   public static final String EDIT_DATE_COLUMN = "edit_date";
   public static final String AMOUNT = "amount";

   @DatabaseField(columnName = Calculation.TITLE_COLUMN)
   private String title;
   @DatabaseField(columnName = Calculation.CREATE_DATE_COLUMN)
   private Date createDate;
   @DatabaseField(columnName = Calculation.EDIT_DATE_COLUMN)
   private Date editDate;

   private List<Person> members;

   public Calculation() {
   }

   public Calculation(String title, List<Person> members, Date editDate) {
      this.title = title;
      this.members = members;
      createDate = new Date();
      this.editDate = editDate;
   }

   public String getTitle() {
      return title;
   }

   public Date getCreateDate() {
      return createDate;
   }

   public Date getEditDate() {
      return editDate;
   }

   public List<Person> getMembers() {
      return members;
   }

   public void setTitle(String title) {
      this.title = title;
   }

   public void setCreateDate(Date createDate) {
      this.createDate = createDate;
   }

   public void setEditDate(Date editDate) {
      this.editDate = editDate;
   }

   public void setMembers(List<Person> members) {
      this.members = members;
   }
}